package OnJava8.c6;

public class ThisDemo {

    int i = 0;

    public ThisDemo increment() {
        i++;
        return this;
    }

    public static void main(String[] args) {
        ThisDemo thisDemo = new ThisDemo();
        thisDemo.increment().increment().increment();
        System.out.println(thisDemo.i);
    }
}
